package com.shekhar.paas.twitter;

import twitter4j.Twitter;
import twitter4j.TwitterFactory;
import twitter4j.conf.ConfigurationBuilder;

public class TwitterAuth {
    private final Twitter twitter;

    public TwitterAuth(String oauthConsumerKey, String oauthConsumerSecret, String oauthAccessToken, String oauthAccessTokenSecret) {
        ConfigurationBuilder builder = new ConfigurationBuilder()
                .setDebugEnabled(true)
                .setOAuthConsumerKey(oauthConsumerKey)
                .setOAuthConsumerSecret(oauthConsumerSecret)
                .setOAuthAccessToken(oauthAccessToken)
                .setOAuthAccessTokenSecret(oauthAccessTokenSecret);

        TwitterFactory twitterFactory = new TwitterFactory(builder.build());
        this.twitter = twitterFactory.getInstance();

    }

    public Twitter getTwitter() {
        return twitter;
    }
}